/**
 *
 */

package org.platform.constant;


import java.util.HashMap;
import java.util.Map;

/**
 * 诊断任务通用信息
 *
 * @author mabb
 */
public class DiagnoseConst {
    //任务故障诊断
    public static final int DIAGNOSE_TYPE_TASK_FAULT = 0;
    // 测试故障诊断
    public static final int DIAGNOSE_TYPE_TEST_FAULT = 1;
    // 故障树故障诊断
    public static final int DIAGNOSE_TYPE_FAULT_TREE = 2;

    //几种故障诊断的测试类型
    //私服测试
    public static final int ANT_DIAGNOSE_TEST = 0;
    //G/T值测试
    public static final int GT_DIAGNOSE_TEST = 1;
    //链路测试
    public static final int LINK_DIAGNOSE_TEST = 2;
    //误码率测试
    public static final int BER_DIAGNOSE_TEST = 3;

    /**
     * 闭环测试枚举
     */
    public enum LoopTypeEnum {
        //中频闭环测试
        IFDataLoopTest(4, "IFDataLoopTest"),
        //X射频，不带场放
        XRFDataLoopTest(5, "XRFDataLoopTest"),
        //S射频，不带场放
        SRFDataLoopTest(6, "SRFDataLoopTest"),
        //大环测试，含场放
        SDataLongLoopTest(7, "SDataLongLoopTest"),
        //大环测试，含场放
        XDataLongLoopTest(8, "XDataLongLoopTest"),
        //S跟踪链路测试，含场放
        STrkLongLoopTest(9, "STrkLongLoopTest"),
        //X跟踪链路测试，含场放
        XTrkLongLoopTest(10, "XTrkLongLoopTest");
        private int val;
        private String description;

        LoopTypeEnum(int val, String description) {
            this.val = val;
            this.description = description;
        }

        public int getVal() {
            return val;
        }

        public String getDescription() {
            return description;
        }
    }

    public static final int DIAGNOSE_ATOM_TASK_FOR_LOOP_RESOURCE_APPLY = 10000;
    public static final int DIAGNOSE_ATOM_TASK_FOR_LOOP_TEST_REQ_APPLY = 10001;

    //失效
    public static final int DIAGNOSE_ABATE = 1;
    //未失效
    public static final int DIAGNOSE_NOT_ABATE = 0;
    //未知
    public static final int DIAGNOSE_ABATE_UNKNOWN = 2;

    //诊断等待
    public static final int DIAGNOSE_STATUS_WAIT = 0;
    //诊断执行
    public static final int DIAGNOSE_STATUS_EXECUTE = 1;
    //诊断废弃（超时）
    public static final int DIAGNOSE_STATUS_ABORT = 3;
    //诊断成功
    public static final int DIAGNOSE_STATUS_SUCCESS = 2;
    //诊断失败
    public static final int DIAGNOSE_STATUS_FAILURE = 4;

    public static final int DIAGNOSE_SUB_FALSE = 0;
    public static final int DIAGNOSE_SUB_TRUE = 1;

    // 成功
    public static final int DIAGNOSE_RESULT_SUCCESS = 0;
    //失败
    public static final int DIAGNOSE_RESULT_FAILURE = 1;
    //废弃（超时）
    public static final int DIAGNOSE_RESULT_ABORT = 2;
    //未开始状态(无结果)
    public static final int DIAGNOSE_RESULT_NONE = 3;
    //手动取消
    public static final int DIAGNOSE_RESULT_CANCEL = 4;
    //无法诊断推理
    public static final int DIAGNOSE_RESULT_NODIAGNOSE = 5;

    //成功
    public static final String SUCCESS = "Success";
    //失败
    public static final String FAILURE = "FAILURE";

    public static final int DIAGNOSE_MODE_MANUAL = 0;

    public static final int LOG_NORMAL = 0;
    public static final int LOG_DIAGNOSE = 1;
    public static final int LOG_EXPERT = 2;
    public static final int LOG_TASK = 3;
    public static final int LOG_MONITOR = 4;

    // 知识类型划分
    public static final int KNOW_TYPE_LOOP_TEST = 0;
    public static final int KNOW_TYPE_FAULT_TREE = 1;
    public static final int KNOW_TYPE_BER = 2;
    public static final int KNOW_TYPE_SPEC = 3;
    public static final int KNOW_TYPE_EVENT = 4;
    public static final int KNOW_TYPE_DEVICE_DOC = 5;
    public static final int KNOW_TYPE_LOOP_TEST_RESULT = 6;

    /*知识状态划分：使用中*/
    public static final int KNOW_STATE_USE = 0;
    /*知识状态划分：申请中*/
    public static final int KNOW_STATE_APPLY = 1;
    /*知识状态划分：申请失败*/
    public static final int KNOW_STATE_APPLY_FAILURE = 2;
    /*知识状态划分：已过时*/
    public static final int KNOW_STATE_OLD = 3;
    /*知识状态划分：待申请*/
    public static final int KNOW_STATE_WAIT_APPLY = 4;

    // 基本故障类型定义
    public static final int EVENT_CONFIRM = 1;
    public static final int EVENT_NOT_CONFIRM = 0;

    public static final int EVENT_RESTORE = 0;
    public static final int EVENT_NOT_RESTORE = 1;
    public static final int EVENT_RESTORE_INIT = 2;

    public static final long FAULT_TREE_TYPE_DEVICE = 1;
    public static final long FAULT_TREE_TYPE_BUSSINESS = 0;
    public static final long FAULT_TREE_TYPE_CUSTOM = 2;

    //任务执行状态
    public static final Map<String, String> stepStatusMap = new HashMap<String, String>() {
        private static final long serialVersionUID = -6276787638700374718L;

        {
            put("0", "正常");
            put("1", "告警");
            put("2", "尚未执行");
        }
    };

    public enum EArithType {
        AND, OR
    }

    /**
     * 监测点类型定义
     * 0:数字类型   1：枚举类型   2：联合检测
     */
    public enum EMonitorType {
        Data(0), EnumT(1), Union(2);

        private int value;

        EMonitorType(int n) {
            this.setValue(n);
        }

        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }
    }


    /**
     * 故障树节点类型枚举值
     */
    public enum FaultTreeNodeTypeEnum {
        DESCRIPTION(0, "描述节点"),
        DIAGNOSE(1, "诊断节点"),
        ALGORITHM(2, "算法节点");

        private int val;
        private String description;

        FaultTreeNodeTypeEnum(int val, String description) {
            this.val = val;
            this.description = description;
        }

        public int getVal() {
            return val;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 诊断记录类型
     */
    public enum DiagnoseRecordTypeEnum {
        TASK(0, "任务诊断"),
        TREE(1, "故障树诊断"),
        TEST(2, "测试诊断");

        private Integer val;
        private String description;

        DiagnoseRecordTypeEnum(Integer val, String description) {
            this.val = val;
            this.description = description;
        }

        public Integer getVal() {
            return val;
        }

        public String getDescription() {
            return description;
        }

    }

    /**
     * 故障树节点诊断类型枚举
     */
    public enum FaultTreeNodeDiagnoseTypeEnum {
        MONITOR(0, "MONITOR"),
        TEST(1, "TEST"),
        TREE(2, "TREE");

        private long val;
        private String description;

        FaultTreeNodeDiagnoseTypeEnum(long val, String description) {
            this.val = val;
            this.description = description;
        }

        public long getVal() {
            return val;
        }

        public String getDescription() {
            return description;
        }
    }


    public enum EFaultTreeType {
        Bussiness(0), Device(1), Custom(2);

        private int val;

        EFaultTreeType(int i) {
            this.val = i;
        }

        public int getValue() {
            return val;
        }
    }

}
